﻿/**********************************************************************
 * @file   GUIGeometryBaseDialog.h
 * @brief  几何界面基类
 * @author liuzhonghua (liuzhonghuaszch@163.com)
 * @date   2025-02-10
 *********************************************************************/
#ifndef _GUIGeometryBaseDialog_H
#define _GUIGeometryBaseDialog_H

#include "GUIGeometryDialogAPI.h"
#include "GUIWidget/GUIDialogBase.h"
#include "FITK_Kernel/FITKCore/FITKAbstractGUI.h"

namespace Interface {
    class FITKAbsGeoCommand;
    class FITKGeoCommandList;
}

namespace Core
{
    class FITKActionOperator;
}

namespace GUI
{
    /**
     * @brief cude create or edit widget
     * @author liuzhonghua (liuzhonghuaszch@163.com)
     * @date 2024-08-14
     */
    class GUIGeometryDialogAPI GUIGeometryBaseDialog : public GUIDialogBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief constructor
         * @param[i]  obj            My Param doc
         * @param[i]  oper           My Param doc
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-08-14
         */
        GUIGeometryBaseDialog(Interface::FITKAbsGeoCommand* obj, Core::FITKActionOperator* oper, QWidget* parent = nullptr);
        /**
         * @brief Destroy the Cude Info Widget object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-08-14
         */
        virtual ~GUIGeometryBaseDialog();
        /**
         * @brief init
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-08-14
         */
        virtual void init() = 0;

    protected:
        /**
         * @brief    启用拾取
         * @param[i] pickObjType 拾取对象类型
         * @param[i] pickMethodType 拾取方式类型
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-10
         */
        void enablePickSig(int pickObjType, int pickMethodType);
        /**
         * @brief    创建数据对象
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-06
         */
        bool createObjData();
        /**
         * @brief    编辑数据对象
         * @return   boiol
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-06
         */
        bool editObjData();
        /**
         * @brief    获取名称
         * @return   QString
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-10
         */
        virtual QString getNameText();
        /**
         * @brief    创建几何数据
         * @param[i] type 类型
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-10
         */
        void createGeometryObj(int type);
        /**
         * @brief Get the Data Form Widget object
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-08-14
         */
        virtual void getDataFormWidget();
        /**
         * @brief    拾取完成操作器
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-02-10
         */
        virtual void pickFinishedOper();
        /**
         * @brief    拾取过程中 处理槽
         * @return   void
         * @author   yangjing (1195810980@qq.com)
         * @date     2025-02-19
         */
        virtual void pickInProcess();

        /**
         * @brief    拾取过程中 处理槽中 调用该函数
         * @return   void
         * @author   yangjing (1195810980@qq.com)
         * @date     2025-02-19
         */
        virtual void OnpickInProcess();

        /**
         * @brief    重写基类reject
         * @return   void
         * @author   yangjing (1195810980@qq.com)
         * @date     2025-02-19
         */
        virtual void reject()override;

    protected:
        /**
         * @brief 几何数据对象
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-08-14
         */
        Interface::FITKAbsGeoCommand* _obj = nullptr;
        /**
         * @brief 操作器对象
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-08-08
         */
        Core::FITKActionOperator* _oper = nullptr;
        /**
         * @brief  几何数据管理器
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-02-10
         */
        Interface::FITKGeoCommandList* _geometryData = nullptr;
        /**
         * @brief current type isCreate
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-08-14
         */
        bool _isCreate = false;
      
        /**
         * @brief  拾取到的几何个数，面就是面个数，体就是体个数
         * @author yangjing (1195810980@qq.com)
         * @date   2025-02-19
         */
        int m_pick_num = 0;


        /**
         * @brief  方向显示工具ID
         * @author yangjing (1195810980@qq.com)
         * @date   2025-02-19
         */
        int m_direction = -1;
    };
}

#endif
